package com.ruoyi.web.task;

import com.ruoyi.system.service.InitService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author lzw
 * 程序启动过程中执行任务
 */
@Slf4j
@Component
@AllArgsConstructor
public class StartRunner implements ApplicationRunner {

    private final InitService initService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        initService.initFaceEngineConfig();
        initService.initFaceEnginePool();
        initService.triggerEngineActivation();
    }
}
